#include <head.h>

int main(int argc, char const *argv[])
{
    pid_t pid;

    pid = fork();
    if (pid == -1)
    {
        ERRLOG("进程创建失败\n");
    }
    else if (pid > 0)
    {
       printf("我是父进程 我的pid = %d\n",getpid());
       while (1)
       {
            sleep(1);
       }  
    }
    else if (pid == 0)
    {
        printf("我是子进程 我的pid = %d\n",getpid());
        printf("我是子进程 我的ppid = %d\n",getppid());
        while (1)
        {
            sleep(1);
        }
        
    }
    
    
    return 0;
}
